import { ProCard } from '@ant-design/pro-card';
import { Descriptions } from 'antd';
import React from 'react';

interface DetailsPermissionProps {
  data: AdminPermissionData.Permission;
  onRefurbish: () => void;
}
const DetailsPermission: React.FC<DetailsPermissionProps> = ({ data, onRefurbish }) => {
  const selectPermissionTypeMap = {
    1: '页面',
    2: '模块',
    3: '按钮',
    4: '方法',
  };

  return (
    <ProCard
      tabs={{
        type: 'card',
      }}
    >
      <ProCard.TabPane key="tab1" tab="权限介绍">
        <Descriptions>
          <Descriptions.Item label="类型">
            {selectPermissionTypeMap[data?.type as number]}
          </Descriptions.Item>
          <Descriptions.Item label="排序">{data?.seq}</Descriptions.Item>
        </Descriptions>
        <Descriptions>
          <Descriptions.Item label="名称">{data?.name}</Descriptions.Item>
          <Descriptions.Item label="代码">{data?.value}</Descriptions.Item>
        </Descriptions>
        <Descriptions>
          <Descriptions.Item label="描述" span={3}>
            {data?.describes}
          </Descriptions.Item>
        </Descriptions>
      </ProCard.TabPane>
    </ProCard>
  );
};
export default DetailsPermission;
